﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:env="xaml://kokomo/environment"
					xmlns:h="clr-namespace:Kokomo.Environment.Hosting"
					xmlns:kui="xaml://kokomo/ui"
					xmlns:doc="clr-namespace:Kokomo.Environment.Documents"
					xmlns:svc="clr-namespace:Kokomo.Environment.Services"
		xmlns:i="clr-namespace:System.Windows.Media.Imaging;assembly=PresentationCore"
					>
	<SolidColorBrush
			x:Key="{x:Static env:EditorStyleKeys.WorkspaceBackgroundBrushKey}"
			Color="Black"
			/>
	<SolidColorBrush
			x:Key="{x:Static env:EditorStyleKeys.SectionBackgroundBrushKey}"
			Color="DarkGray"
			/>
	<SolidColorBrush
			x:Key="{x:Static env:EditorStyleKeys.ActiveTabColorKey}"
			Color="DarkGray"
			/>
	<Style
		TargetType="{x:Type Border}"
		x:Key="{x:Static env:EditorStyleKeys.SectionBorderStyleKey}"
		>
		<Setter Property="CornerRadius" Value="6"/>
		<Setter Property="Padding" Value="6"/>
		<Setter Property="Background" Value="{DynamicResource {x:Static env:EditorStyleKeys.SectionBackgroundBrushKey}}"/>
	</Style>
	<Style TargetType="{x:Type TabControl}" x:Key="{x:Static env:EditorStyleKeys.SectionTabControlStyleKey}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TabControl}">
					<DockPanel>
						<TabPanel DockPanel.Dock="Top" IsItemsHost="True" Margin="6 0 6 0"/>

						<Border
							Style="{DynamicResource {x:Static env:EditorStyleKeys.SectionBorderStyleKey}}"
							DockPanel.Dock="Top"
							>
							<ContentPresenter Name="PART_SelectedContentHost" Margin="6" ContentSource="SelectedContent"/>
						</Border>

					</DockPanel>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type TabItem}" x:Key="{x:Static env:EditorStyleKeys.SectionTabStyleKey}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TabItem}">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition/>
							<ColumnDefinition/>
							<ColumnDefinition/>
						</Grid.ColumnDefinitions>

						<Path
							Name="LeadingCurve"
							Visibility="Hidden"
							Width="6"
							Height="6"
							Data="M 0 6 A 6 6 90 0 0 6 0 V 6"
							Fill="{TemplateBinding Background}"
							VerticalAlignment="Bottom"
								HorizontalAlignment="Right"
							/>

						<Border
							Grid.Column="1"
							Padding="4"
							CornerRadius="4 4 0 0"
							Background="{TemplateBinding Background}"
							>
							<ContentPresenter
								ContentSource="Header"
								ContentTemplate="{TemplateBinding HeaderTemplate}"
								/>
						</Border>

						<Path
								Name="TrailingCurve"
								Grid.Column="2"
								Visibility="Hidden"
								Width="6"
								Height="6"
								Data="M 0 6 V 0 A 6 6 90 0 06 6"
								Fill="{TemplateBinding Background}"
								VerticalAlignment="Bottom"
								HorizontalAlignment="Left"
								/>
					</Grid>

					<ControlTemplate.Triggers>
						<Trigger Property="IsSelected" Value="True">
							<Setter TargetName="LeadingCurve" Property="Visibility" Value="Visible"/>
							<Setter TargetName="TrailingCurve" Property="Visibility" Value="Visible"/>

						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>

		<Style.Triggers>
			<Trigger Property="IsSelected" Value="True">
				<Setter Property="Background" Value="{DynamicResource {x:Static env:EditorStyleKeys.ActiveTabColorKey}}"/>
			</Trigger>
			<Trigger Property="IsSelected" Value="False">
				<Setter Property="Background" Value="Transparent"/>
				<Setter Property="Foreground" Value="White"/>
			</Trigger>
		</Style.Triggers>
	</Style>
</ResourceDictionary>